package com.edu.scnu.element;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;

public class Text extends ElementObj{

	private String[] str;
	
	public Text() {
		
	}
	
	@Override
	public ElementObj createElement(String str) {
		this.str = str.split(";");
		return this;
	}
	/**
	 * 面向对象的第一个思想：对象自己的事情自己做
	 */
	@Override
	public void showElement(Graphics g) {
		g.setColor(Color.white);
		g.setFont(new Font("微软雅黑", Font.BOLD, 38));
		int y = 300;
		for (int i = 0; i < this.str.length; i++) {
			g.drawString(this.str[i], 120, y);
			y += 50;
		}
	}
			

		
}
